﻿using System;
using System.ComponentModel;
using System.Diagnostics;
using System.Windows;
using System.Windows.Controls;

namespace Flare.Pages
{
    public partial class StartPage : UserControl, INotifyPropertyChanged, ITypicalPage
    {
        public string name
        {
            get { return "Начало"; }
        }

        public StartPage()
        {
            InitializeComponent();

            glob.PublicPropertyChange += (s, e) =>
            {
                PropertyChanged(this, e);
            };
        }

        private void ListBoxItem_MouseLeftButtonDown(object sender, RoutedEventArgs e)
        {
            int id = ((Flare.DB.Entity.EndpointView)((sender as ListBoxItem).Content)).id;
            glob.kernel.ShowPage(typeof(Pages.Endpoint.Details),id);
            e.Handled = true;
        }

        private void HardwareButton_Click(object sender, RoutedEventArgs e)
        {
            glob.kernel.ShowPage(typeof(Pages.Hards.Index));
        }

        private void NetworkButton_Click(object sender, RoutedEventArgs e)
        {
            glob.kernel.ShowPage(typeof(Pages.Endpoint.Index));
        }

        private void ContractButton_Click(object sender, RoutedEventArgs e)
        {
            glob.kernel.ShowPage(typeof(Pages.ITContract.Index));
        }

        private void ReportButton_Click(object sender, RoutedEventArgs e)
        {
            glob.kernel.ShowPage(typeof(Pages.Reports.ReportsMenu));
        }

        private void ConfigButton_Click(object sender, RoutedEventArgs e)
        {
            glob.kernel.ShowPage(typeof(Pages.Managment));
        }
              
        public event PropertyChangedEventHandler PropertyChanged = delegate { };

    }
}
